<template>
  <div id="cars">
    <el-tabs v-model="activeName" @tab-click="handleTab">
      <el-tab-pane label="销项发票登记" name="1">
        <sell ref="sellRef" />
      </el-tab-pane>
      <el-tab-pane label="购项发票登记" name="2"
        ><purchase ref="purchaseRef" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import sell from "./sell.vue";
import purchase from "./purchase.vue";
export default {
  components: {
    sell,
    purchase,
  },
  data() {
    return {
      activeName: "1",
    };
  },
  methods: {
    handleTab() {
      this.activeName == 1
        ? this.$refs.purchaseRef.getList()
        : this.$refs.sellRef.getList();
    },
  },
};
</script>

<style lang="scss" scoped>
.search_box {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #ccc;
  .el-input,
  .el-select {
    width: 200px;
    margin-right: 20px;
    margin-bottom: 20px;
  }
  .el-date-editor {
    margin-right: 20px;
    margin-bottom: 20px;
  }
  .el-button {
    margin-bottom: 20px;
  }
}
.export_box {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0;
}
.page_table {
  margin-top: 20px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}
</style>
